#include <iostream>
#include <set>
#include <string>

using namespace std;

#define max(a,b) ((a)>=(b)?(a):(b))

class Solution
{
public:
    int lengthOfLongestSubstring(string s)
	{
		unsigned int maxLength=0;
		string tmp="";
		set<char> sTable;

		for(string::size_type i=0;i<s.length();++i)
		{
			sTable.clear();
			for(string::size_type j=i;j<s.length();++j)
			{
				if(sTable.count(s[j])==1)
				{
					maxLength=max(maxLength,sTable.size());
					break;
				}
				else
				{
					sTable.insert(s[j]);
				}
			}
			maxLength=max(maxLength,sTable.size());
			if(m_MaxLength==maxLength)
			{
				break;
			}
		}

		return maxLength;
    }
private:
	static const int m_MaxLength=95;
};

int main()
{
	Solution s;
	cout<<s.lengthOfLongestSubstring("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ");

	return 0;
}